<script setup lang="ts">
import { LoginForm } from './components'
import { useDesign } from '@/hooks/web/useDesign'
import { ref } from 'vue'
import { ElScrollbar } from 'element-plus'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
const isLogin = ref(true)
const toRegister = () => {
  isLogin.value = false
}
</script>

<template>
  <div
    :class="prefixCls"
    class="h-[100%] relative lt-xl:bg-[var(--login-bg-color)] lt-sm:px-10px lt-xl:px-10px lt-md:px-10px bg"
  >
    <ElScrollbar class="h-full">
      <div class="relative flex mx-auto min-h-100vh">
        <div :class="`${prefixCls}__left flex-1  relative p-30px lt-xl:hidden`">
          <div class="flex justify-center items-center h-[calc(100%-60px)]">
            <TransitionGroup
              appear
              tag="div"
              enter-active-class="animate__animated animate__bounceInLeft"
            >
              <img src="@/assets/svgs/loginBg.svg" key="1" alt="" class="w-350px" />

            </TransitionGroup>
          </div>
        </div>
        <div class="flex-1 p-30px lt-sm:p-10px dark:bg-[var(--login-bg-color)] relative">
          <Transition appear enter-active-class="animate__animated animate__bounceInRight">

            <div
              class="login-container h-full flex items-center m-auto w-[100%] at-2xl:max-w-500px at-xl:max-w-500px at-md:max-w-500px at-lg:max-w-500px"
            >
              <LoginForm
                v-if="isLogin"
                class="p-20px h-auto m-auto lt-xl:rounded-3xl lt-xl:light:bg-white"
                @to-register="toRegister"
              />

            </div>
          </Transition>
        </div>
      </div>
    </ElScrollbar>
  </div>
</template>

<style lang="less" scoped>
@prefix-cls: ~'@{adminNamespace}-login';

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 400px;

  height: 100%;


}
:deep(.el-form) {
  background-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0px 0px 15px 0px rgba(110, 109, 109, 0.5);
  -webkit-box-shadow: 0px 0px 15px 0px rgba(110, 109, 109, 0.5);
  -moz-box-shadow: 0px 0px 15px 0px rgba(110, 109, 109, 0.5);
  // border: 1px solid rgb(190, 187, 187) !important;
  border-radius: 16px 16px 16px 16px;
}

.@{prefix-cls} {
  overflow: auto;

  &__left {
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      // background: rgba(49, 94, 243, 0.85);
      background: linear-gradient(90deg, rgba(49, 94, 243, 1) 0%, rgba(255, 255, 255, 0.5) 100%);
      // background-image: url('@/assets/svgs/login-bg.svg');
      // background-position: center;
      // background-repeat: no-repeat;
      content: '';
    }
  }
}
</style>
